/*
 * ========================================================
 * Copyright(c) 2014 杭州偶尔科技-版权所有
 * ========================================================
 * 本软件由杭州偶尔科技所有, 未经书面许可, 任何单位和个人不得以
 * 任何形式复制代码的部分或全部, 并以任何形式传播。
 * 公司网址
 * 
 * 			http://www.kkkd.com/
 * 
 * ========================================================
 */
package com.simon.mengkou.ui.activity;

import android.os.Bundle;

import com.simon.mengkou.R;
import com.simon.mengkou.data.enums.Type;
import com.simon.mengkou.system.constant.CstOuer;
import com.simon.mengkou.system.global.OuerApplication;
import com.simon.mengkou.system.global.OuerDispatcher;
import com.simon.mengkou.ui.base.BaseRulesActivity;
import com.simon.mengkou.ui.view.StrokeTextView;
import com.umeng.socialize.bean.SHARE_MEDIA;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @author : Zhenshui.Xia
 * @since : 2016/1/5.
 * desc    :扭蛋拉新界面
 */
public class NDRulesActivity extends BaseRulesActivity {
    //分享内容
    private String mShareContent;
    //邀请码
    @Bind(R.id.rules_id_code)
    StrokeTextView mStvCode;

    @Override
    protected void init(Bundle savedInstanceState) {
        super.init(savedInstanceState);
        //获取分享内容
        mShareContent = getString(R.string.rules_share_content,
                OuerApplication.mUser.getInvitationCode());
    }

    @Override
    protected void initLayout() {
        setContentView(R.layout.activity_rules);
    }

    @Override
    protected void initViews() {
        ButterKnife.bind(this);

        mStvCode.setText(OuerApplication.mUser.getInvitationCode());
    }

    /**
     * 打开扭蛋中心界面
     */
    @OnClick(R.id.rules_id_center)
    public void presetCenter(){
        OuerDispatcher.presentNiudanActivity(this, NDNiudanActivity.FRAGMENT_CENTER);
    }

    /**
     * 扭蛋列表
     */
    @OnClick(R.id.rules_id_start)
    public void presentOptions() {
        OuerDispatcher.presentNiudanActivity(this, NDNiudanActivity.FRAGMENT_OPTIONS);
    }

    /**
     * sina分享
     */
    @OnClick(R.id.rules_id_sina)
    public void shareSina(){
        share(SHARE_MEDIA.SINA, getString(R.string.app_name),
                mShareContent, CstOuer.OFFICAL_URL, "");
    }

    /**
     * 微信分享
     */
    @OnClick(R.id.rules_id_wechat)
    public void shareWechat(){
        share(SHARE_MEDIA.WEIXIN, getString(R.string.app_name),
                mShareContent, CstOuer.OFFICAL_URL, "");
    }

    /**
     * qq分享
     */
    @OnClick(R.id.rules_id_qq)
    public void shareQQ(){
        share(SHARE_MEDIA.QQ, getString(R.string.app_name),
                mShareContent, CstOuer.OFFICAL_URL, "");
    }
}
